package modele;

import java.util.List;

public abstract class Tache {

    private int nTache; 
    private int tauxAvancement;
    private String categorie;
   

    private int priorite;
    private Indicateur indicDeb;
	private Indicateur indicFin;
    private int responsable;
	private String description;
    private int tacheMere;
    private static int numTaches=0;
    
    public Tache(int tauxAvancement, String categorie,
			int priorite, Indicateur indicDeb, Indicateur indicFin,
			int responsable, String description, int tacheMere) {
		super();
		this.nTache = numTaches;
		this.tauxAvancement = tauxAvancement;
		this.categorie = categorie;
		this.priorite = priorite;
		this.indicDeb = indicDeb;
		this.indicFin = indicFin;
		this.responsable = responsable;
		this.description = description;
		this.tacheMere = tacheMere;
		
		//on incremente la variable static numTaches
		numTaches++;
	}
    
    public static int getNumTaches() {
        return numTaches;
    }

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + nTache;
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Tache other = (Tache) obj;
		if (nTache != other.nTache)
			return false;
		return true;
	}
    
    @Override
    public String toString() {
        return "Tache [nTache=" + nTache + ", tauxAvancement=" + tauxAvancement
                + ", categorie=" + categorie + ", priorite=" + priorite
                + ", indicDeb=" + indicDeb.toString() + ", indicFin=" + indicFin.toString()
                + ", responsable=" + responsable + ", description="
                + description + ", tacheMere=" + tacheMere + "]";
    }
    
    public int getnTache() {
		return nTache;
	}


	public void setnTache(int nTache) {
		this.nTache = nTache;
	}


	public int getTauxAvancement() {
		return tauxAvancement;
	}


	public void setTauxAvancement(int tauxAvancement) {
		this.tauxAvancement = tauxAvancement;
	}


	public String getCategorie() {
		return categorie;
	}


	public void setCategorie(String categorie) {
		this.categorie = categorie;
	}


	public int getPriorite() {
		return priorite;
	}


	public void setPriorite(int priorite) {
		this.priorite = priorite;
	}


	public Indicateur getIndicDeb() {
		return indicDeb;
	}


	public void setIndicDeb(Indicateur indicDeb) {
		this.indicDeb = indicDeb;
	}


	public Indicateur getIndicFin() {
		return indicFin;
	}


	public void setIndicFin(Indicateur indicFin) {
		this.indicFin = indicFin;
	}


	public int getResponsable() {
		return responsable;
	}


	public void setResponsable(int responsable) {
		this.responsable = responsable;
	}


	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public void setTacheMere(int tacheMere) {
		this.tacheMere = tacheMere;
	}

    public int getTacheMere() {
        return this.tacheMere;
    }
    
    public abstract void modifEtatAv();

    public abstract void informations(int nTache);
    
    public abstract void ajouterAffiliation(int Ntfille,int Ntmere);

    public abstract void suppAffiliation(int Ntfille,int Ntmere);

}

